package com.zuihai.app.mvp.ui.holder;

import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.zuihai.app.R;
import com.zuihai.app.mvp.model.entity.FindItem;

import butterknife.BindView;

/**
 * Created by Zc on 2017/5/9.
 */

public class FindRecyclerHolder extends BaseViewHolderWraper<FindItem> {

    @BindView(R.id.iv_cover)
    ImageView mCoverView;

    @BindView(R.id.tv_title)
    TextView mTitleView;

    public FindRecyclerHolder(View itemView) {
        super(itemView);
    }

    @Override
    public void fillData(FindItem data, int position) {
        super.fillData(data, position);
        if (data.picture != null && !data.picture.isEmpty()) {
            loadImage(R.id.iv_cover, data.picture.get(0).pictureUrl);
        }
        setText(R.id.tv_title, data.title);
        setText(R.id.tv_auther, data.auther);
        setTextFormat(R.id.tv_comment, data.commentCount);
        setTextFormat(R.id.tv_favour, data.favourCount);
    }
}
